import { S } from '../../s';
import { IPSAppCodeList } from '../../app/codelist/ipsapp-code-list';
import { IPSAppDEField } from '../../app/dataentity/ipsapp-defield';
import { IPSDETreeNodeDataItem } from './ipsdetree-node-data-item';
import { PSDataItemImpl } from '../../data/psdata-item-impl';

export class PSDETreeNodeDataItemImpl
  extends PSDataItemImpl
  implements IPSDETreeNodeDataItem
{
  get cLConvertMode(): 'NONE' | 'FRONT' | 'BACKEND' {
    return this.M.cLConvertMode;
  }

  get defaultValue(): string {
    return this.M.defaultValue;
  }

  protected frontpscodelist: IPSAppCodeList;
  getFrontPSCodeList(): IPSAppCodeList | null {
    return (
      this.frontpscodelist ||
      (this.frontpscodelist = this.fillObjectModel(
        S._8,
        this.M.getFrontPSCodeList,
        S._376,
      ) as IPSAppCodeList)
    );
  }

  protected psappdefield: IPSAppDEField;
  getPSAppDEField(): IPSAppDEField | null {
    return (
      this.psappdefield ||
      (this.psappdefield = this.fillObjectModel(
        S._1,
        this.M.getPSAppDEField,
        S._2e4,
      ) as IPSAppDEField)
    );
  }

  get privilegeId(): string {
    return this.M.privilegeId;
  }

  get scriptCode(): string {
    return this.M.scriptCode;
  }

  get customCode(): boolean {
    return this.M.customCode != null ? this.M.customCode : false;
  }

  get dataAccessAction(): boolean {
    return this.M.dataAccessAction != null ? this.M.dataAccessAction : false;
  }

  get enableItemPriv(): boolean {
    return this.M.enableItemPriv != null ? this.M.enableItemPriv : false;
  }
  get cls(): string {
    return 'PSDETreeNodeDataItemImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._293) return true;
    return super.instanceof(cls);
  }
}
